import VueRouter from "vue-router";

const router = new VueRouter({
    routes: [
        {
            path: "/", redirect: "/home",
        },
        {
            path: "/home",
            component: () => import("./components/nav/HomeContainer.vue"),
            meta: { title: "首页" }
        },
        {
            path: "/book-category",
            component: () => import("./views/books/BookCategory.vue"),
            meta: { title: "商品分类" }
        },
        {
            path: "/book-detail/:id",
            component: () => import("./views/books/BookDetail.vue"),
            meta: { title: "图书明细" }
        },
        {
            path: "/programming-book",
            component: () => import("./views/books/ProgrammingBook.vue"),
            meta: { title: "图书明细" }
        },
        {
            path: "/shop-cart",
            component: () => import("./components/nav/ShopCartContainer.vue"),
            meta: { title: "购物车" }
        },
        {
            path: "/my",
            component: () => import("./components/nav/MyContainer.vue"),
            meta: { title: "我的" }
        },
        {
            path: "/order",
            component: () => import("./components/nav/OrderContainer.vue"),
            meta: { title: "订单" }
        },
    ],
    // 覆盖默认的路由高亮的类
    linkActiveClass: "mui-active"
})

export default router;